Drop gdk_device_get_position
authorMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2019 11:44:17 +0000 (07:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2019 18:04:08 +0000 (18:04 +0000)
Root coordinates are going away, so this
api does not make sense anymore. Use
gdk_surface_get_device_position instead.
We still keep this as internal api for
root-coordinate using backends.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkdevice.c
gdk/gdkdevice.h
gdk/gdkinternals.h

index 3aa9caa9ca7366cd1bdf0401f31abde2f5d6b9ee..c2b259898953456125574778093ece2ec6bbdb92 100644 (file)
@@ -479,7 +479,6 @@ gdk_device_get_seat
 
 <SUBSECTION>
 gdk_device_get_state
-gdk_device_get_position
 gdk_device_get_surface_at_position
 gdk_device_get_history
 gdk_device_free_history
index b352a8441174328e9210625ab6fcf0f7b707958e..532d5c519cd07fcab10560aca135eea28454e220 100644 (file)
@@ -528,24 +528,20 @@ gdk_device_get_state (GdkDevice       *device,
     GDK_DEVICE_GET_CLASS (device)->get_state (device, surface, axes, mask);
 }
 
-/**
+/*
  * gdk_device_get_position:
  * @device: pointer device to query status about.
- * @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
- * @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
+ * @x: (out): location to store root window X coordinate of @device
+ * @y: (out): location to store root window Y coordinate of @device
  *
- * Gets the current location of @device in double precision. As a slave device's
- * coordinates are those of its master pointer, this function
- * may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
- * unless there is an ongoing grab on them. See gdk_seat_grab().
- **/
+ * Gets the current location of @device in double precision.
+ */
 void
 gdk_device_get_position (GdkDevice *device,
                          double    *x,
                          double    *y)
 {
   GdkDisplay *display;
-  gdouble tmp_x, tmp_y;
 
   g_return_if_fail (GDK_IS_DEVICE (device));
   g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
@@ -555,16 +551,7 @@ gdk_device_get_position (GdkDevice *device,
   g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
                     gdk_display_device_is_grabbed (display, device));
 
-  _gdk_device_query_state (device,
-                           NULL,
-                           NULL,
-                           &tmp_x, &tmp_y,
-                           NULL, NULL, NULL);
-
-  if (x)
-    *x = tmp_x;
-  if (y)
-    *y = tmp_y;
+  _gdk_device_query_state (device, NULL, NULL, x, y, NULL, NULL, NULL);
 }
 
 /**
index 1e65d6c0eab1ec562d703c933ca416ec0b2a0c49..27242a8c296ff38f4b468ef9ea2f373b2ffc3e4a 100644 (file)
@@ -167,10 +167,6 @@ void     gdk_device_get_state    (GdkDevice         *device,
                                   gdouble           *axes,
                                   GdkModifierType   *mask);
 GDK_AVAILABLE_IN_ALL
-void     gdk_device_get_position (GdkDevice *device,
-                                  double    *x,
-                                  double    *y);
-GDK_AVAILABLE_IN_ALL
 GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
                                                  double    *win_x,
                                                  double    *win_y);
index ad9ca06e05893effb79646daa36621feea0458a4..e23a33338f60d7f2e6ed35688ee872f69f47bc9d 100644 (file)
@@ -245,6 +245,11 @@ GdkGrabStatus gdk_device_grab (GdkDevice        *device,
                                guint32           time_);
 void gdk_device_ungrab        (GdkDevice        *device,
                                guint32           time_);
+void gdk_device_get_position  (GdkDevice        *device,
+                               double           *x,
+                               double           *y);
+
+
 void gdk_surface_get_root_coords (GdkSurface *surface,
                                   gint        x,
                                   gint        y,